package pers.wang.toolset.coder.statecode;

public class CommonResponse<T> {
	

	/**
	 * 服务请求状态
	 */
	private int state;
	/**
	 * 服务返回描述
	 */
	private String msg = null;
	/**
	 * 服务返回数据
	 */
	private T data;
	
	public CommonResponse() {
		super();
	}

	protected CommonResponse(int state, T data) {
		this.state = state;
		this.data = data;
	}

	protected CommonResponse(int state, String msg) {
		this.state = state;
		this.msg = msg;
	}

	protected CommonResponse(int state, T responseData, String msg) {
		this.state = state;
		this.msg = msg;
		this.data = responseData;
	}

	protected void setState(int state) {
		this.state = state;
	}

	protected void setMsg(String msg) {
		this.msg = msg;
	}

	protected void setData(T data) {
		this.data = data;
	}

	public int getState() {
		return state;
	}

	public String getMsg() {
		return msg;
	}

	public T getData() {
		return data;
	}
	
	@Override
	public String toString() {
		return "CommonResponse [state=" + state + ", msg=" + msg + ", data=" + data + "]";
	}
}
